INSERT INTO ${targetTable}
		  (BATCHTIMESTAMP,
		   WEEK_OF_YEAR,
		   INDICATORTYPE_ID,		   
		   NETWORKSERVING_ID,
		    <#list dimensionAttributeTypes as t>
		           ${t.columnName},   
		            </#list>
		   
		   
		   VALUE1,
		   VALUE2,
		   VALUE3,
		   VALUE4,
		   VALUE5,
		   VALUE6,
		   VALUE7,
		   VALUE8,
		   VALUE9,
		   VALUE10,
		   VALUE11,
		   VALUE12)
		  SELECT O.BATCHTIMESTAMP_,
		  		 TO_NUMBER(TO_CHAR(O.BATCHTIMESTAMP_, 'WW')),
		         O.INDICATORTYPE_ID,		         
		         O.NETWORKSERVING_ID,
		          <#list dimensionAttributeTypes as t>
		            O.${t.columnName},   
		            </#list>
		         
		         
		         AVG(O.VALUE1),
		         AVG(O.VALUE2),
		         AVG(O.VALUE3),
		         AVG(O.VALUE4),
		         AVG(O.VALUE5),
		         AVG(O.VALUE6),
		         AVG(O.VALUE7),
		         AVG(O.VALUE8),
		         AVG(O.VALUE9),
		         AVG(O.VALUE10),
		         AVG(O.VALUE11),
		         AVG(O.VALUE12)
		    FROM (SELECT TRUNC(T.BATCHTIMESTAMP, 'DAY') BATCHTIMESTAMP_, T.*
		            FROM ${sourceTable} T) O
		   GROUP BY O.INDICATORTYPE_ID,
		            O.NETWORKSERVING_ID,
		             <#list dimensionAttributeTypes as t>
		            O.${t.columnName},   
		            </#list>
		            
		            O.BATCHTIMESTAMP_;
